////////////////////////////////////////////////////////////////////////////////////////
// Stauffer Public Perceptions of Women's Inclusion and Feelings of Political Efficacy
// Replication Code - Appendix 2
///////////////////////////////////////////////////////////////////////////////////////

***********
// TABLE A1
***********

*set working directory
use 1618_CCES.dta

///Full Sample
*Additive
xtmixed efficacy_1 c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen woman_rep c.stateleg i.year || state: , cov(uns)

estimates store add_full

*Interactive
xtmixed efficacy_1 c.r_estimate##i.gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen##i.gender_r i.woman_rep##i.gender_r c.stateleg##i.gender_r i.year || state:, cov(uns)

estimates store interactive_full


///2016
*Additive
xtmixed efficacy_1 c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen woman_rep c.stateleg ///
if year==2016 || state:, cov(uns)

estimates store add_16

*Interactive
xtmixed efficacy_1 c.r_estimate##i.gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen##i.gender_r i.woman_rep##i.gender_r c.stateleg##i.gender_r if year==2016 || state:, cov(uns)

estimates store interactive_16

///2018
*Additive
xtmixed efficacy_1 c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen woman_rep c.stateleg if year==2018 || state:, cov(uns)

estimates store add_18

*Interactive
xtmixed efficacy_1 c.r_estimate##i.gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen##i.gender_r i.woman_rep##i.gender_r c.stateleg##i.gender_r if year==2018 || state: , cov(uns)

estimates store interactive_18

*Generate Latex Code For Table
estout add_full interactive_full add_16 interactive_16 add_18 interactive_18, cells(b(star fmt(%9.3f)) se(par)) ///
style(tex) stats(N) nobaselevels interaction ("X") starlevels (* .1 ** .05 *** .01)
